Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io: add async BufReader/BufWriter #1438

Merged
merged 1 commit into from
Aug 14, 2019
Merged

io: add async BufReader/BufWriter #1438

merged 1 commit into from
Aug 14, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Aug 14, 2019

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍 great work as always.

@carllerche carllerche merged commit 999a600 into tokio-rs:master Aug 14, 2019
@ohmyarch
Copy link

@taiki-e Thanks! I can't wait to write some test code, but it didn't compile:

use tokio::{
    io::{AsyncBufReadExt, BufReader},
    net::TcpStream,
    prelude::*,
};

async fn foo() {
    let mut socket = TcpStream::connect("some address".parse().unwrap()).await.unwrap();
    let (reader, writer) = socket.split();
    let mut reader = BufReader::new(reader);
    reader.read_unitl(b'\n', vec![]).await.unwrap();
}

error[E0599]: no method named read_unitl found for type tokio_io::io::buf_reader::BufReader<tokio_tcp::split::TcpStreamReadHalf> in the current scope

@taiki-e
Copy link
Member Author

taiki-e commented Aug 15, 2019

@ohmyarch That's typo...

-    reader.read_unitl(b'\n', vec![]).await.unwrap();
+    reader.read_until(b'\n', vec![]).await.unwrap();

@taiki-e taiki-e deleted the io-buffered branch August 15, 2019 08:09
@ohmyarch
Copy link

@taiki-e Oh my God! Sorry, I am so stupid😂. It seems that I was spoiled by g++ (which reminds me of typo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add futures::io::BufReader Equivalent
3 participants